Fix Ascii IFD reading as TIFF6.0 spec #1451
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #187
The TIFF6 specification writes:
python-docx by default uses the Value/Offset field as a offset for ASCII IFD, but sometime the Value/Offset field could contain directly the Value (if it contains a string with 4 or less characters including the final NULL byte/string terminator)
This is the case for the 2 pictures linked in issue #187 (the
![image](https://private-user-images.githubusercontent.com/686894/391050145-a4e3393e-9da3-4ec9-9db3-9ddaf2029c4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNjg2NzAsIm5iZiI6MTczOTI2ODM3MCwicGF0aCI6Ii82ODY4OTQvMzkxMDUwMTQ1LWE0ZTMzOTNlLTlkYTMtNGVjOS05ZGIzLTlkZGFmMjAyOWM0YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMVQxMDA2MTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04YTg2NWU1NmM2NjRmNGNiNGU5NjRiZTEwMWI4NTAxNDg4MjQyYTAzMDAzOGU2MThhMjcyYTM0ZDRjMjFjNmI5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.bnvQ82NmYZ8DXy7fCbHwzMWDb8kbkh27d4NEzGxB-es)
Software
ASCII field contains8.3
)